package com.yztc.orangeentertainment.ui.main.subscribefragment.contentitem;

import com.yztc.orangeentertainment.bean.starconbean.CategoryDataBean;
import com.yztc.orangeentertainment.config.SubscribeUrlConfig;

import java.util.Map;

/**
 * Created by My on 2016/10/10.
 * 订阅item present
 */
public class CategoryPresenter implements CategoryContract.Presenter {
    private CategoryContract.View view;
    private CategoryModle modle;

    public CategoryPresenter(CategoryContract.View view) {
        this.view = view;
        modle = new CategoryModle();
    }

    @Override
    public void getCategoryFromNet(Map<String, String> map) {
        modle.getCategoryAll(SubscribeUrlConfig.PATH.URL_CATEGORY_TYPE, map, new OnLoadCategoryListener() {
            @Override
            public void onSuccess(CategoryDataBean categoryDataBean) {
                view.getCategoryListSuccess(categoryDataBean);
            }

            @Override
            public void onFailure(Exception e) {
                view.getCategoryListFail(e.getMessage());
            }
        });
    }
}